package com.xidian.zhiancloud.dao.exam;

import java.util.List;

import org.apache.ibatis.annotations.Param;

import com.github.pagehelper.Page;
import com.xidian.zhiancloud.model.exam.ExamQuestionAnswer;
import com.xidian.zhiancloud.model.exam.ExamTypeCount;
import com.xidian.zhiancloud.model.exam.TExamConfig;
import com.xidian.zhiancloud.model.exam.TExamPaper;
import com.xidian.zhiancloud.model.exam.TExamPeperQuestion;
import com.xidian.zhiancloud.model.exam.TExamQuestion;
import com.xidian.zhiancloud.qo.BaseReqQuery;

/**
 * 试卷Mapper接口
 * 
 * @author zhouweitao
 * @date 2021-03-05
 */
public interface TExamPaperMapper 
{
    /**
     * 查询试卷
     * 
     * @param id 试卷ID
     * @return 试卷
     */
    public TExamPaper selectTExamPaperById(Long id);

    /**
     * 查询试卷列表
     * 
     * @param tExamPaper 试卷
     * @return 试卷集合
     */
    public Page<TExamPaper> selectTExamPaperList(TExamPaper tExamPaper);

    /**
     * 新增试卷
     * 
     * @param tExamPaper 试卷
     * @return 结果
     */
    public int insertTExamPaper(TExamPaper tExamPaper);

    /**
     * 修改试卷
     * 
     * @param tExamPaper 试卷
     * @return 结果
     */
    public int updateTExamPaper(TExamPaper tExamPaper);

    /**
     * 删除试卷
     * 
     * @param id 试卷ID
     * @return 结果
     */
    public int deleteTExamPaperById(Long id);

    /**
     * 批量删除试卷
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    public int deleteTExamPaperByIds(Long[] ids);

	public void insertPaperConfig(TExamConfig config);

	public void insertPaperQuestions(List<TExamPeperQuestion> questions);

	public void updateConfig(TExamConfig config);

	public void deletePaperQuestionByIds(Long[] ids);
	
	public Page<ExamTypeCount> getTypeCount(BaseReqQuery query);
	
	public TExamConfig getPaperConfig(Long id);
	
	public List<TExamQuestion> getPaperByConfig(TExamConfig config);

	public List<TExamQuestion> getPaper(Long id);

	public int insertTExamPaperAnswers(List<ExamQuestionAnswer> answers);

	public List<TExamQuestion> getPaperAnswers(@Param("id")Long id,@Param("userId")Long userId);
	public List<TExamQuestion> getPaperAnswers2(@Param("id")Long id,@Param("userId")Long userId);
}
